﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Game.model;

namespace Game.ai
{
    public class ClonePlayerAI:PlayableAI
    {
        public ClonePlayerAI(ClonePlayer actor):base(actor)
	    {
		    //super;
	    }
	
	    protected override void thinkActive()
	    {
		    ClonePlayer actor = getActor();
		    clearNextAction();
		    if (actor.isFollowMode())
		    {
			    changeIntention(CtrlIntention.AI_INTENTION_FOLLOW, actor.getPlayer(), Config.FOLLOW_RANGE);
			    thinkFollow();
		    }
		    base.thinkActive();
	    }
	    protected override void onEvtAttacked(Creature attacker, int damage)
	    {
		    ClonePlayer actor = getActor();
		    if ((attacker != null) && actor.getPlayer().isDead())
		    {
			    Attack(attacker, false, false);
		    }
		    base.onEvtAttacked(attacker, damage);
	    }
	    public override ClonePlayer getActor()
	    {
		    return (ClonePlayer) base.getActor();
	    }
    }
}
